<?php $this->_extends(Helper_Store::layout()); ?>
<?php $this->_block('title'); 
if(!empty($g)&&!$g->isNewRecord()){
	echo $g->title .'  '. $g->sn.' ';
}
$title='';
	if(isset($navigation)) foreach($navigation as $n){
		$title=$n['title'].' '.$title;
	}
	echo $title;
?>  <?=$store['name']?> <?php $this->_endblock(); ?>
<?php $this->_block('contents'); ?>
<div id="MainWrap">

	<div id="InnerLeftColumn">
			<?php $this->_element('categories'); ?>
			<?php $this->_element('tags'); ?>
	</div>

	<div id="InnerRightColumn">
	<div class="Navigation">
		<span><a href="<?=_url('')?>" alt="" title=""><?=_L('index')?></a></span>
		<span>&raquo;</span>
		<?php if(isset($navigation)) foreach($navigation as $n):?>
		<span><a href="<?=$n['url']?>" alt="<?=$n['title']?>" title="<?=$n['title']?>"><?=$n['title']?></a></span>
		<span>&raquo;</span> 
		<?php endforeach;?>
		<span class="now"> </span>
	</div>
	
	<div class="GoodsInfoWrap">
		<div id="goods-viewer">
		<a name="top"></a>
		<table width="100%">
			<tr><td align="center" valign="top"><div class="goodspic">
				<div class="goods-detail-pic" style="width: 300px; height: 300px;">
				<a href="<?=_url('product',array('goods_id'=>$g->goods_id))?>"  style="visibility: visible; opacity: 1; margin-top: 0px;"> 
				<img src="<?=$g->imgurl?>" height="<?=Store_Configs::get('middleimgheight')?>" width="<?=Store_Configs::get('middleimgwidth')?>" />
				</a>
				</div></div>
			</td><td valign="top" width="60%">
			<form class="goods-action" action="<?=_url('cartadd')?>"  method="post" >
				<h1 class="goodsname"><?=$g->title?></h1>
				<ul class="goods-price list">
				<?php if(($g->market_price>0)&&($g->market_price>$g->price)):  $saved=$g->market_price-$g->price;?>
				<li><span><?=_L('market_price')?> ：</span><i class="mktprice1"><?=Helper_currency::fetch($g->market_price,$g->currency)?></i></li>
				<?php endif;?>
				<li><span><?=_L('price')?>：</span><span class="price1"> <?=Helper_currency::fetch($g->price,$g->currency)?> </span></li>
				<?php if(isset($savedprice)):?>
				<li><span>saved：</span><span class="price1"> <?=Helper_currency::fetch($saved,$g->currency)?> </span></li>
				<?php endif;?>
				</ul>

				<div class="buyinfo">
				<table width="">
					<tr>
					<td><span><?=_L('quantity')?> ：</span></td>
					<td> <div class=""><input name="quantity[<?=$g->goods_id?>]" size="5" value="1" type="text">
					<span class="numadjust increase"></span>
					<span class="numadjust decrease"></span></div></td>
					<td> <span style="display: none;">&nbsp;&nbsp;(Stock:<span class="store"><?=$g->stock?></span>)</span></td></tr>
					
					<?php  if(is_array($g->props)) foreach($g->props as $prop):
					$code='props['.$prop['code'].']';
					?>
					<tr><td>
						<?=$prop['name']?>:
					</td><td>
				    <?php Q::control('dropdownlist',$code,array(
								"items"=>array_combine($prop['values'],$prop['options']),
							))->display();
					?>
					</td></tr>
					<?php endforeach;?>
					
					</table>
				</div>
					
					<input name="goods[goods_id]" value="<?=$g->goods_id?>" type="hidden">
					
					<div class="btnBar"><div class="floatLeft">
					<input style="cursor: pointer;" class="actbtn btn-buy" value="<?=_L('add_to_cart')?>" type="submit"><input class="actbtn btn-notify" value=" <?=_L('buy')?>  " style="display: none;" type="submit"></div>
					
					
					<!--ul class="floatLeft">  <li class="star-off" title=""> <a href="http://localhost:88/shopex/?passport-login.html" class="btn-fav">  </a></li> <li><a href="#" class="btn-send"> </a></li> </ul-->
					</div></form>
					
					<div style="clear:both"></div>
					<?php if($g->shipping_free): ?>
						<br />
						<div><font color="#FF0000"><b><?=_L('goods/freeshipping')?></b></font></div>
					<?php endif;?> 
					</td></tr>
				</table>
			<div class="body indent" id="goods-intro">
			
			
			<?=$g->desc?>
				<div>
					<div style=" float:right"><a href="#top"> ^  Top</a></div>
				</div>
			</div>
		
	</div>
	
	</div></div>
	<div style="clear:both"></div>
	
	
<?php $this->_endblock('contents'); ?>
